model_type=$1
type=$2
if [[ $type =~ "normal" ]];then
    # normal
    echo "*********use $model_type $type to onnx"
    bash samples/bevformer/$model_type/pth2onnx.sh

    echo "*********use $model_type $type to trt"
    bash samples/bevformer/$model_type/onnx2trt.sh

    echo "*********use $model_type $type trt eval"
    bash samples/bevformer/$model_type/trt_evaluate.sh

elif [ $type == "fp16" ]; then
    echo "*********use $model_type $type to onnx"
    bash samples/bevformer/$model_type/pth2onnx.sh

    echo "*********use $model_type $type to trt"
    bash samples/bevformer/$model_type/onnx2trt_fp16.sh

    echo "*********use $model_type $type trt eval"
    bash samples/bevformer/$model_type/trt_evaluate_fp16.sh

elif [ $type == "int8" ]; then
    echo "*********use $model_type $type to onnx"
    bash samples/bevformer/$model_type/pth2onnx.sh

    echo "*********use $model_type $type to trt"
    bash samples/bevformer/$model_type/onnx2trt_int8.sh

    echo "*********use $model_type $type trt eval"
    bash samples/bevformer/$model_type/trt_evaluate_int8.sh

# onnx to tensorrt engine, need to define presice, int8, int8/fp16
elif [ $type == "int8_ptq" ]; then
    echo "*********use $model_type $type do post training"
    bash samples/bevformer/$model_type/quant_max_ptq.sh

    echo "*********use $model_type $type to onnx "
    bash samples/bevformer/$model_type/pth2onnx_q.sh

    echo "*********use $model_type $type to trt "
    bash samples/bevformer/$model_type/onnx2trt_int8_qdq.sh

    echo "*********use $model_type $type to eval "
    bash samples/bevformer/$model_type/trt_evaluate_int8_qdq.sh

elif [ $type == "fp16_int8" ]; then
    echo "*********use $model_type $type do post training"
    # bash samples/bevformer/$model_type/quant_max_ptq.sh

    echo "*********use $model_type $type to onnx "
    bash samples/bevformer/$model_type/pth2onnx.sh

    echo "*********use $model_type $type to trt "
    bash samples/bevformer/$model_type/onnx2trt_int8_fp16.sh

    echo "*********use $model_type $type to eval "
    bash samples/bevformer/$model_type/trt_evaluate_int8_fp16.sh



fi
